package com.knife.bbs.domain;

import java.text.SimpleDateFormat;
import java.util.Date;

import com.knife.dbo.IObject;
import com.knife.util.CommUtil;

/**
 * BBS文档信息-通过实现IObject接口支持KnifeDBO零配置文件方式映射
 * 
 */
public class BBSDoc implements IObject {
	// Fields
	private static final SimpleDateFormat df = new SimpleDateFormat("yyyyMMdd");
	private String cid;
	private String dirsn;
	private String dirpath;
	private String parentid;
	private String title;
	private String content;
	private String intro;
	private String files;
	private String imgs;
	private Integer readtimes;
	private String tagpic;
	private Integer votescore;
	private Integer score;
	private String vrtype;
	private String vrvalue;
	private String inputuser;
	private Date inputtime;
	private Date modifytime;
	private String ip;
	private String clientinfo;
	private Integer good;
	private Integer bad;
	private String source;
	private Integer topmessage;
	private Integer elitemessage;
	private Integer status;
	private Integer hasvote;

	private String lastupdateuser;
	private Date lastupdatetime;
	private Integer replynum;

	public Integer getHasvote() {
		return hasvote;
	}

	public void setHasvote(Integer hasvote) {
		this.hasvote = hasvote;
	}

	public String getKeyField() {
		// TODO Auto-generated method stub
		return "cid";
	}

	public String getKeyGenerator() {
		// TODO Auto-generated method stub
		return "com.knife.dbo.RandomIdGenerator";
	}

	public String getTableName() {
		// TODO Auto-generated method stub
		return "BBSDoc";
	}

	// Property accessors
	public Integer getBad() {
		return bad;
	}

	public void setBad(Integer bad) {
		this.bad = bad;
	}

	public String getCid() {
		return cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}

	public String getClientinfo() {
		return clientinfo;
	}

	public void setClientinfo(String clientInfo) {
		this.clientinfo = clientInfo;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getDirsn() {
		return dirsn;
	}

	public void setDirsn(String dirSn) {
		this.dirsn = dirSn;
	}

	public String getFiles() {
		return files;
	}

	public void setFiles(String files) {
		this.files = files;
	}

	public Integer getGood() {
		return good;
	}

	public void setGood(Integer good) {
		this.good = good;
	}

	public String getImgs() {
		return imgs;
	}

	public void setImgs(String imgs) {
		this.imgs = imgs;
	}

	public Date getInputtime() {
		return inputtime;
	}

	public void setInputtime(Date inputTime) {
		this.inputtime = inputTime;
	}

	public String getInputuser() {
		return inputuser;
	}

	public void setInputuser(String inputUser) {
		this.inputuser = inputUser;
	}

	public String getIntro() {
		return intro;
	}

	public void setIntro(String intro) {
		this.intro = intro;
	}

	public String getIp() {
		return ip;
	}

	public void setIp(String ip) {
		this.ip = ip;
	}

	public Date getModifytime() {
		return modifytime;
	}

	public void setModifytime(Date modifyTime) {
		this.modifytime = modifyTime;
	}

	public String getParentid() {
		return parentid;
	}

	public void setParentid(String parentId) {
		this.parentid = parentId;
	}

	public Integer getReadtimes() {
		return readtimes;
	}

	public void setReadtimes(Integer readTimes) {
		this.readtimes = readTimes;
	}

	public Integer getScore() {
		return score;
	}

	public void setScore(Integer score) {
		this.score = score;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getTagpic() {
		return tagpic;
	}

	public void setTagpic(String tagPic) {
		this.tagpic = tagPic;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Integer getVotescore() {
		return votescore;
	}

	public void setVotescore(Integer voteScore) {
		this.votescore = voteScore;
	}

	public String getVrtype() {
		return vrtype;
	}

	public void setVrtype(String type) {
		vrtype = type;
	}

	public String getVrvalue() {
		return vrvalue;
	}

	public void setVrvalue(String value) {
		vrvalue = value;
	}

	public Integer getElitemessage() {
		return elitemessage;
	}

	public void setElitemessage(Integer eliteMessage) {
		this.elitemessage = eliteMessage;
	}

	public Integer getTopmessage() {
		return topmessage;
	}

	public void setTopmessage(Integer topMessage) {
		this.topmessage = topMessage;
	}

	public Date getLastupdatetime() {
		return lastupdatetime;
	}

	public void setLastupdatetime(Date lastUpdateTime) {
		this.lastupdatetime = lastUpdateTime;
	}

	public String getLastupdateuser() {
		return lastupdateuser;
	}

	public void setLastupdateuser(String lastUpdateUser) {
		this.lastupdateuser = lastUpdateUser;
	}

	public Integer getReplynum() {
		return replynum;
	}

	public void setReplynum(Integer replyNum) {
		this.replynum = replyNum;
	}

	public String getDirpath() {
		return dirpath;
	}

	public void setDirpath(String dirPath) {
		this.dirpath = dirPath;
	}

	public String toString() {
		// TODO Auto-generated method stub
		String ret = "BBSDoc:     cid" + cid + "   dirsn" + dirsn
				+ "   parentid" + parentid + "   title" + title + "   hasvote"
				+ hasvote + "   status" + status;
		return ret;
	}

	public void setDoc(com.knife.bbs.object.BBSDoc doc) {
		if (doc.getCid() != null) {
			if (doc.getCid().length() > 0) {
				this.cid = doc.getCid();
			}
		}
		this.bad = doc.getBad();
		this.clientinfo = doc.getClientinfo();
		this.content = doc.getContent();
		this.dirpath = doc.getDirpath();
		this.dirsn = doc.getDirsn();
		this.elitemessage = doc.getElitemessage();
		this.files = doc.getFiles();
		this.good = doc.getGood();
		this.hasvote = doc.getHasvote();
		this.imgs = doc.getImgs();
		this.inputtime = doc.getInputtime();
		this.inputuser = doc.getInputuser();
		this.intro = doc.getIntro();
		this.ip = doc.getIp();
		this.lastupdatetime = doc.getLastupdatetime();
		this.lastupdateuser = doc.getLastupdateuser();
		this.modifytime = doc.getModifytime();
		this.parentid = doc.getParentid();
		this.readtimes = doc.getReadtimes();
		this.replynum = doc.getReplynum();
		this.score = doc.getScore();
		this.source = doc.getSource();
		this.status = doc.getStatus();
		this.tagpic = doc.getTagpic();
		this.title = doc.getTitle();
		this.topmessage = doc.getTopmessage();
		this.votescore = doc.getVotescore();
		this.vrtype = doc.getVrtype();
		this.vrvalue = doc.getVrvalue();
	}
}
